package com.example.administrator.tenyuanpackage.home.mvp;

import com.example.administrator.tenyuanpackage.home.bean.PreferentialBean;
import com.example.administrator.tenyuanpackage.home.bean.ResultBean;
import com.example.administrator.tenyuanpackage.home.bean.ResultsGoodsBean;
import com.example.administrator.tenyuanpackage.home.net.NetUtils;

import java.util.ArrayList;
import java.util.HashMap;
import java.util.Map;

import rx.Observable;

/**
 * Created by zwq on 2017/2/27.
 */

public class HomeModeImpl implements IHomeModel {

    Map<String,String> map=new HashMap<>();
    Map<String,String> map1=new HashMap<>();

    @Override
    public Observable<ResultBean> getLoopObservabal() {
        map.put("v","34");

        return NetUtils.getInstance().getApi().getLoopData(map);
    }

    @Override
    public Observable<ArrayList<PreferentialBean>> getPreferentialObservabal() {
        return NetUtils.getInstance().getApi().getPreferentialData();
    }

    @Override
    public Observable<ResultsGoodsBean> getGoodsObservabal(int page) {
        map1.put("act","getproductlist");
        map1.put("v","34");
        map1.put("pages",String.valueOf(page));
        map1.put("bc","0");
        map1.put("sc","0");
        map1.put("sorts","");
        map1.put("channel","0");
        map1.put("ckey","");
        map1.put("daynews","");
        map1.put("lprice","0");
        map1.put("hprice","0");
        map1.put("tbclass","0");
        map1.put("actid","0");
        map1.put("brandid","0");
        map1.put("predate","2016-08-28+17%3A43%3A19");
        map1.put("index","1");

        return NetUtils.getInstance().getApi().getGoodsData(map1);
    }
}
